package com.huaxingbankas.modules.servicesimpl;

import java.util.List;


import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.huaxingbankas.modules.dao.UsersDAO;
import com.huaxingbankas.modules.daoimpl.UsersDaoImpl;
import com.huaxingbankas.modules.model.Users;
import com.huaxingbankas.modules.services.UsersServices;

@Service
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
public class UsersServicesImpl implements UsersServices {
	
	@Resource
	private UsersDAO userdao = new UsersDaoImpl();
	
	@Override
	@Transactional(readOnly = false, propagation = Propagation.REQUIRED)
	public boolean save(Users users) {
		// TODO Auto-generated method stub
		return userdao.save(users);
	}

	@Override
	@Transactional(readOnly = false, propagation = Propagation.REQUIRED)
	public boolean[] save(Users[] users) {
		// TODO Auto-generated method stub
		return userdao.save(users);
	}

	@Override
	@Transactional(readOnly = false, propagation = Propagation.REQUIRED)
	public boolean remove(Users user) {
		// TODO Auto-generated method stub
		return userdao.remove(user);
	}



	@Override
	@Transactional(readOnly = false, propagation = Propagation.REQUIRED)
	public void remove(Users[] users) {
		// TODO Auto-generated method stub
		userdao.remove(users);
	}

	@Override
	@Transactional(readOnly = false, propagation = Propagation.REQUIRED)
	public boolean removeById(Integer id) {
		// TODO Auto-generated method stub
		return userdao.removeById(id);
	}

	@Override
	@Transactional(readOnly = false, propagation = Propagation.REQUIRED)
	public void removeByIds(Integer[] ids) {
		// TODO Auto-generated method stub
		userdao.removeByIds(ids);
	}

	@Override
	public List<Users> findAll() {
		// TODO Auto-generated method stub
		
		return userdao.findAll();
	}

	@Override
	public Users findById(Integer id) {
		// TODO Auto-generated method stub
		return (Users) userdao.find(id);
	}

	@Override
	public Users[] findByIds(Integer[] ids) {
		// TODO Auto-generated method stub
		return (Users[]) userdao.find(ids);
	}
	
//	@Override
//	public Users findByUsername(String Username) {
//		// TODO Auto-generated method stub
//		return (Users) userdao.findByUsername(Username);
//	}

	@Override
	public void flush() {
		// TODO Auto-generated method stub
		userdao.flush();
	}

	@Override
	public boolean equal(Users users) {
		// TODO Auto-generated method stub
		return userdao.equals(users);
	}

	@Override
	public Users findByUsername(String Username) {
		// TODO Auto-generated method stub
		return userdao.findByUsername(Username);
	}



}
